package org.light.framework.orm;

import org.light.framework.util.ConfigUtil;
import org.light.framework.util.TextUtil;

/**
 * SQL查询日志类
 * @author de.cel
 *
 */
public class SQLLoger {

	/**
	 * 记录程序执行的SQL语句
	 * 
	 * @param sql
	 * @param listParams
	 */
	public static void write(String sql, Object... listParams) {
		
		if (ConfigUtil.getBoolean("sql.log", true)) {
			String filename = "sql.log";

			//TextUtil.console(filename, sql + "\r\n",true);

			System.out.println(sql);
			
			for (Object item : listParams) {
				//TextUtil.console(filename, item == null ? "null" : item.toString());
				System.out.println(item);
			}
		}
	}

}
